package com.middle.experiment01.Service.impl;


import com.middle.experiment01.Service.StudentService;
import com.middle.experiment01.entity.Student;
import com.middle.experiment01.mapper.StudentMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    public Student getById(Long id) {
        Student student=studentMapper.getById(id);
        return student;
    }


    public List<Student> pageAllStudent() {
        return studentMapper.pageAllStudent();
    }

    public void save(Student student) {
        studentMapper.insert(student);
    }

    public void deleteById(int id) {
        studentMapper.deleteById(id);
    }

    public void update(Student student) {
        studentMapper.update(student);
    }

}
